<?php

class Pldkp_Db_Table_Row_Abstract extends Zend_Db_Table_Row_Abstract
{
    public function save()
    {
        if (!$this->validate()) {
            // Consinder implementing a way to relay message via exceptions for instance
            return false;
        }
        
        return parent::save();
    }
    
    /**
     * Does this entry exists in the database, or is it a new one.
     * Will be true for a row that exists in the database.
     * This code is based on the insert/update selection in save.
     * 
     * @return bool
     */
    public function exists()
    {
        if (empty($this->_cleanData)) {
            return false;
        }
        return true;
    }
    
    public function validate()
    {
        return true;
    }
}